<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改地址</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui-flex.css"/>
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
    <style>
        .aui-radio {
            margin-top: 13px;
        }
    </style>
</head>
<body>
<div class="aui-content">
    <ul class="aui-list-view   ">
        <li class="aui-list-view-cell aui-flex-col aui-padded-0-10  aui-padded-t-5 aui-padded-b-5">
            <div class="aui-flex-item-3 aui-flex-row aui-flex-middle">联系人</div>
            <div class="aui-flex-item-9"><input class="aui-margin-0 noBorder name" type="text" placeholder="单击输入姓名">
            </div>
        </li>
        <li class="aui-list-view-cell aui-flex-col aui-padded-0-10 aui-padded-t-5 aui-padded-b-5">
            <div class="aui-flex-item-3 aui-flex-row aui-flex-middle">联系方式</div>
            <div class="aui-flex-item-9"><input value="" class="aui-margin-0 noBorder phone" type="tel"
                                                placeholder="单击输入联系方式"></div>
        </li>
        <!--<li class="aui-list-view-cell aui-flex-col aui-padded-0-10">-->
        <!--<div class="aui-flex-item-3 aui-flex-row aui-flex-middle">收货地址</div>-->
        <!--<div class="aui-flex-item-9"><input class="aui-margin-0 noBorder addresInfo" type="text" placeholder="点击添加收货地址"></div>-->
        <!--</li>-->
        <li class="aui-list-view-cell aui-flex-col aui-padded-0-10 aui-padded-t-5 aui-padded-b-5">
            <div class="aui-flex-item-3 aui-flex-row aui-flex-middle">地址详情</div>
            <div class="aui-flex-item-9"><input class="aui-margin-0 noBorder addresInfo" type="text"
                                                placeholder="请补充地址信息，如3号楼4单元106"></div>
        </li>

    </ul>
</div>


</body>
<script src="../script/api.js"></script>
<script src="../script/common.js"></script>
<script src="../script/mui.min.js"></script>
<script src="../script/jquery.min.js"></script>
<script>
    var addressId = "", goodId = "", orderType = "", count, aijiangliOrderId = "";
    apiready = function () {
        showLoading()
        api.parseTapmode();
        addressId = api.pageParam.addressId;
        getAdddressInfo();
    }
    function getAdddressInfo() {

        showLoading()
        var url = "user/addressinfo";
        var data = {};
        data["address_id"] = addressId;


        ajaxRequest(url, 'get', data, function (ret, err) {


            $(".name").val(ret.data.consignee);
            $(".phone").val(ret.data.mobile);
            $(".addresInfo").val(ret.data.address);

        });
    }
    function updateAddress() {
        var name = $(".name").val();
        var phone = $(".phone").val();
        var addressInfo = $(".addresInfo").val();

        showLoading()
        var url = "user/update_address";
        var data = {};
        data["address_id"] = addressId;
        data["consignee"] = name;
        data["mobile"] = phone;
        data["address"] = addressInfo;

        getStorageAll();
        ajaxRequest(url, 'post', data, function (ret, err) {

            api.sendEvent({
                name: "updateAddress",
                extra: {
                    key: true
                }
            })
            api.toast({
                msg: "修改成功！",
                location: "middle"
            })
            setTimeout(function () {
                closeWin();
            }, 1500)

        });
    }
</script>
</html>